package com.woniu.bank.service.impl;

import com.github.pagehelper.PageHelper;
import com.woniu.bank.dto.MemberDTO;
import com.woniu.bank.dto.MemberIsDeleteDTO;
import com.woniu.bank.dto.NewClientfoDTO;
import com.woniu.bank.entity.Member;
import com.woniu.bank.mapper.MemberMapper;
import com.woniu.bank.service.MemberService;
import com.woniu.bank.vo.MemberClientInfoSheetVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @author ：zhuboyuan
 * @date ：Created in 2023/1/4 16:36
 * @description：c{description}
 * @modified By：
 * @version: $
 */
@Service
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberMapper memberMapper;


    @Override
    public int deleteByPrimaryKey(Long id) {
        return memberMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Member record) {
        return memberMapper.insert(record);
    }

    @Override
    public int insertSelective(Member record) {
        return memberMapper.insertSelective(record);
    }

    @Override
    public Member selectByPrimaryKey(Long id) {
        return memberMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Member record) {
        return memberMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Member record) {
        return memberMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<MemberClientInfoSheetVO> selectMember(MemberDTO memberDTO) {
        PageHelper.startPage(memberDTO.getCurrentPage(),memberDTO.getPageSize());
        List<MemberClientInfoSheetVO> memberClientInfoSheetVOS = memberMapper.selectMember(memberDTO);
        return memberClientInfoSheetVOS;
    }

    @Override
    public int updateGroup(NewClientfoDTO newClientfoDTO) {
        return memberMapper.updateGroup(newClientfoDTO);
    }

    @Override
    public int updateIsDelete(MemberIsDeleteDTO memberIsDeleteDTO) {
        return memberMapper.updateIsDelete(memberIsDeleteDTO);
    }
}
